"""
ihrm登录接口 对象层
"""
import requests

# 定义ihrm 登录接口类
from config import BASE_URL


class IhrmLoginApi():
    # 定义类方法
    @classmethod
    def login(cls,req_data):
        resp = requests.post(url=BASE_URL+"/api/sys/login",
                             headers={"Content-Type": "application/json"},
                             json=req_data)
        return resp


# 测试 接口封装是否成功
if __name__ == '__main__':
    # 准备请求体数据
    json = {"mobile": "13800000002", "password": "929itheima.CN032@.20250330"}
    resp=IhrmLoginApi.login(json)
    print("登录成功:",resp.json())